home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 21
/
AMIGAplus Sonderheft 21 (1999)(ICP)(DE)[!].iso
/
PublicDomain
/
System
/
recoverdeldir
/
arexx
/
Check
next >
Wrap
Text File
|
1999-08-23
|
2KB
|
82 lines
/* ARexxScript (checks existence and versions of programs) */
PARSE ARG Prg Ver
IF Open('lg','ENV:language','R') THEN DO
language = ReadLn('lg')
Call Close('lg')
END
ELSE Language = "english"
IF EXISTS(Prg) THEN DO
IF language = 'deutsch' THEN
Text = "Die Datei*n"||Prg||"*nwurde gefunden :-)"
ELSE
Text = "The file*n"||Prg||"*nwas found :-)"
ex = 1
END
ELSE DO
IF language = 'deutsch' THEN
Text = "Die Datei*n"||Prg||"*nwurde hier NICHT gefunden !"
ELSE
Text = "The file*n"||Prg||"*nwasn`t found here !"
ex = 0
END
IF ex = 1 & Word(Ver,1) = "Port" THEN DO
erg = SHOW('P',Word(Ver,2))
IF erg = 0 THEN DO
IF language = 'deutsch' THEN
Text = Text||"*n*nAber das Programm läuft nicht !"
ELSE
Text = Text||"*n*nBut the program isn`t running !"
END
ELSE DO
IF language = 'deutsch' THEN
Text = Text||"*n*nDas Programm läuft.*nPortname : "Word(Ver,2)
ELSE
Text = Text||"*n*nThe program is running.*nPortname is : "Word(Ver,2)
END
Ver = ""
END
IF ex = 1 & Ver ~= "" THEN DO
Address command 'c:version 'Prg' > Ram:T/PrgVersion'
CALL OPEN('vers','Ram:T/PrgVersion','R')
PVer = Word(ReadLn('vers'),2)
CALL CLOSE('vers')
address command 'c:delete Ram:T/PrgVersion'
Ver1 = Strip(Left(Ver,Pos(".",Ver)-1),'L')
Ver2 = SubStr(Ver,Pos(".",Ver)+1)
PVer1 = Left(PVer,Pos(".",PVer)-1)
PVer2 = SubStr(PVer,Pos(".",PVer)+1)
PVer2 = SubStr(PVer,Pos(".",PVer)+1)
IF PVer1 < Ver1 THEN lower = 1
IF PVer1 = Ver1 & PVer2 < Ver2 THEN lower = 1
IF lower = 1 THEN DO
IF language = 'deutsch' THEN
Text = Text||"*n*nAber die Version ist zu niedrig !*nGefunden : "||PVer||"*nGefordert:"||Ver
ELSE
Text = Text||"*n*nBut it`s version is too low !*nFound : "||PVer||"*nNeeded:"||Ver
END
ELSE DO
IF language = 'deutsch' THEN
Text = Text||"*n*nDie Version "||PVer||" ist OK"
ELSE
Text = Text||"*n*nThe version "||PVer||" is OK"
END
END
IF Exists('c:RequestChoice') THEN
address command 'c:RequestChoice "Check" "*n'Text'*n" "OK"'
ELSE DO
IF OPEN('Shell','CON:160/50/400/100/Check/CLOSE/WAIT') THEN DO
DO WHILE POS('*n',Text) > 0
text = Overlay(D2C(10),text,Pos('*n',text),2)
END
WriteLn('Shell',D2C(10)||' 'text)
CALL CLOSE('Shell')
END
END
EXIT